home *** CD-ROM | disk | FTP | other *** search
/ Sprite 1984 - 1993 / Sprite 1984 - 1993.iso / src / lib / c / stdlib / strtod.man < prev    next >
Encoding:
Text File  |  1989-03-22  |  2.0 KB  |  55 lines

  1. ' Copyright 1989 Regents of the University of California
  2. ' Permission to use, copy, modify, and distribute this
  3. ' documentation for any purpose and without fee is hereby
  4. ' granted, provided that this notice appears in all copies.
  5. ' The University of California makes no representations about
  6. ' the suitability of this material for any purpose.  It is
  7. ' provided "as is" without express or implied warranty.
  8. ' $Header: /sprite/src/lib/c/stdlib/RCS/strtod.man,v 1.1 89/01/05 18:00:47 ouster Exp $ SPRITE (Berkeley)
  9. .so \*(]ltmac.sprite
  10. .HS strtod cmds
  11. .BS
  12. .SH NAME
  13. strtod \- Convert character string to floating-point number
  14. .SH SYNOPSIS
  15. .nf
  16. \fB#include <stdlib.h>
  17.  
  18. \fBdouble
  19. \fBstrtod(\fIstring\fR, \fIendPtr\fR)
  20. .SH ARGUMENTS
  21. .AS "char *" endPtr
  22. .AP char *string in
  23. String containing ASCII representation of floating-point number.
  24. .AP char **endPtr out
  25. If not \fBNULL\fR, gives address of pointer to fill in with address of
  26. first character not forming part of number.
  27. .BE
  28.  
  29. .SH DESCRIPTION
  30. .PP
  31. The \fBstrtod\fR procedure parses a floating-point number in ASCII
  32. representation and returns a \fBdouble\fR result containing the
  33. binary form of the number.  The expected
  34. form of \fIstring\fR is an optional plus or minus sign, then a sequence
  35. of decimal digits optionally containing a decimal point, then an
  36. optional exponent part.  If the exponent part is present, it consists
  37. of the letter \fBE\fR (or \fBe\fR), then an optional plus or minus sign,
  38. then a sequence of decimal digits.  The entire floating-point number
  39. may be preceded by any amount of white space (as defined by the
  40. \fBisspace\fR procedure).
  41. .PP
  42. \fIStrtod\fR examines as many characters as possible from \fIstring\fR
  43. while still obeying the syntax rules given above.
  44. If \fIendPtr\fR is not \fBNULL\fR, then the address of the first
  45. character following the floating-point number is stored in \fI*endPtr\fR.
  46. .PP
  47. If \fIstring\fR does not refer to a floating-point number in the format
  48. given above, then zero is returned and \fIstring\fR will be stored at
  49. \fI*endPtr\fR.
  50.  
  51. .SH KEYWORDS
  52. convert, floating-point, string
  53.